.class Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;
.super Lcom/glympse/platform/common/GTimer;
.source "ViewHistory.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/ViewHistory;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "UpdateTimer"
.end annotation


# instance fields
.field final synthetic this$0:Lcom/glympse/android/glympse/ViewHistory;


# direct methods
.method public constructor <init>(Lcom/glympse/android/glympse/ViewHistory;J)V
    .locals 0
    .parameter
    .parameter "lInterval"

    .prologue
    .line 848
    iput-object p1, p0, Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;->this$0:Lcom/glympse/android/glympse/ViewHistory;

    .line 847
    invoke-direct {p0, p2, p3}, Lcom/glympse/platform/common/GTimer;-><init>(J)V

    return-void
.end method


# virtual methods
.method public OnTimer()V
    .locals 8

    .prologue
    .line 854
    invoke-static {}, Lcom/glympse/platform/common/CorrectedTime;->GetTime()J

    move-result-wide v0

    .line 857
    .local v0, lCurrent:J
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oSentTickets:Lcom/glympse/platform/common/SentTicketList;

    invoke-virtual {v4}, Lcom/glympse/platform/common/SentTicketList;->GetExpireTime()J

    move-result-wide v2

    .line 866
    .local v2, lExpireTime:J
    iget-object v4, p0, Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;->this$0:Lcom/glympse/android/glympse/ViewHistory;

    invoke-static {v4}, Lcom/glympse/android/glympse/ViewHistory;->access$20(Lcom/glympse/android/glympse/ViewHistory;)J

    move-result-wide v4

    invoke-static {v4, v5, v2, v3}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v4

    const-wide/32 v6, 0x36ee80

    add-long/2addr v4, v6

    cmp-long v4, v4, v0

    if-lez v4, :cond_1

    .line 878
    iget-object v4, p0, Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;->this$0:Lcom/glympse/android/glympse/ViewHistory;

    iget-object v4, v4, Lcom/glympse/android/glympse/ViewHistory;->m_oGlympseView:Lcom/glympse/android/glympse/ViewHistory$MyGlympseView;

    const/high16 v5, 0x4000

    invoke-virtual {v4, v5}, Lcom/glympse/android/glympse/ViewHistory$MyGlympseView;->DoUpdate(I)V

    .line 890
    iget-object v4, p0, Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;->this$0:Lcom/glympse/android/glympse/ViewHistory;

    invoke-static {v4}, Lcom/glympse/android/glympse/ViewHistory;->access$21(Lcom/glympse/android/glympse/ViewHistory;)J

    move-result-wide v4

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v6

    iget-wide v6, v6, Lcom/glympse/platform/Platform;->m_lLastSessionTimestamp:J

    invoke-static {v4, v5, v6, v7}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v4

    const-wide/16 v6, 0x7530

    add-long/2addr v4, v6

    cmp-long v4, v4, v0

    if-gtz v4, :cond_0

    .line 892
    const-string v4, "HistoryView: Forcing server post to update view"

    invoke-static {v4}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 893
    iget-object v4, p0, Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;->this$0:Lcom/glympse/android/glympse/ViewHistory;

    invoke-static {v4, v0, v1}, Lcom/glympse/android/glympse/ViewHistory;->access$22(Lcom/glympse/android/glympse/ViewHistory;J)V

    .line 894
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v4

    iget-object v4, v4, Lcom/glympse/platform/Platform;->m_oServerPost:Lcom/glympse/platform/common/ServerPost;

    invoke-virtual {v4}, Lcom/glympse/platform/common/ServerPost;->PostNow()V

    .line 908
    :cond_0
    :goto_0
    return-void

    .line 901
    :cond_1
    iget-object v4, p0, Lcom/glympse/android/glympse/ViewHistory$UpdateTimer;->this$0:Lcom/glympse/android/glympse/ViewHistory;

    invoke-static {v4}, Lcom/glympse/android/glympse/ViewHistory;->access$4(Lcom/glympse/android/glympse/ViewHistory;)V

    goto :goto_0
.end method
